Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@camsim99
Copy link
Contributor

@camsim99 camsim99 commented Aug 26, 2022

Fixes the following to make the iOS FlutterSpellCheckPlugin compatible with the framework:

  • Sets nativeSpellCheckServiceDefined to true since iOS supports spell check.
  • Translates the Dart locale format to the language iOS format when needed.
  • Modifies indices of spell check suggestion spans (there was an off-by-one).

Also removes unnecessary line from Android SpellCheckPlugin I encountered.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@cyanglaz
Copy link
Contributor

Tests added/fixed, removing need test label

NSDictionary* suggestionsJSON1 = capturedResult.firstObject;
XCTAssertEqualObjects(suggestionsJSON1[@"startIndex"], @0);
XCTAssertEqualObjects(suggestionsJSON1[@"endIndex"], @4);
XCTAssertEqualObjects(suggestionsJSON1[@"endIndex"], @5);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right?

This isss misspelled
xxxxx^^^^xx
01234567890

Start index is 5, length is 4, end index is 8, not 9.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://api.flutter.dev/flutter/dart-ui/TextRange-class.html

The next index after the characters in this range.

Well that's confusing, as you experienced from the off by one error... Can you add a comment about that in toDictionary? In Objective-C this is usually expressed with a tuple range of start index + length, that the endIndex is after the range is not intuitive.

Copy link
Member

@jmagman jmagman Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Case '-[FlutterSpellCheckPluginTest testFindAllSpellCheckSuggestionsForText]' started.
/../../flutter/shell/platform/darwin/ios/framework/Source/FlutterSpellCheckPluginTest.mm:164: error: -[FlutterSpellCheckPluginTest testFindAllSpellCheckSuggestionsForText] : ((suggestionsJSON1[@"endIndex"]) equal to (@4)) failed: ("5") is not equal to ("4")
/../../flutter/shell/platform/darwin/ios/framework/Source/FlutterSpellCheckPluginTest.mm:168: error: -[FlutterSpellCheckPluginTest testFindAllSpellCheckSuggestionsForText] : ((suggestionsJSON2[@"endIndex"]) equal to (@9)) failed: ("10") is not equal to ("9")
Test Case '-[FlutterSpellCheckPluginTest testFindAllSpellCheckSuggestionsForText]' failed (0.061 seconds).

@jmagman
Copy link
Member

jmagman commented Sep 7, 2022

Unfortunately I think you're hitting something relating to #35843, can you rebase onto top of tree?

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zanderso
Copy link
Member

zanderso commented Sep 8, 2022

From PR triage: It looks like this PR needs to be rebased as @jmagman says.

@jmagman
Copy link
Member

jmagman commented Sep 8, 2022

Now you're hitting flutter/flutter#111193 😞 you'll have to wait until that's fixed and then rebase or merge again

@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 14, 2022
@auto-submit auto-submit bot merged commit 9eb565b into flutter:main Sep 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 14, 2022
Oleh-Sv pushed a commit to Oleh-Sv/engine that referenced this pull request Sep 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-android platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants